// FrogRenameAutoAlphaAppendDialog.h : Declaration of the CFrogRenameAutoAlphaAppendDialog

#pragma once

#include "resource.h"       // main symbols
#include <atlhost.h>
#include <FrogOrderFilesDialog.h>

class CFrogRenameAutoAlphaAppendDialog: public CFrogOrderFilesDialog<CFrogRenameAutoAlphaAppendDialog>,
	public CWinDataExchange<CFrogRenameAutoAlphaAppendDialog>
{
public:
	CFrogRenameAutoAlphaAppendDialog(HICON hIcon);	
	virtual ~CFrogRenameAutoAlphaAppendDialog();

	enum { IDD = IDD_DIALOG_RENAME_ALPHA_APPEND };

	BEGIN_MSG_MAP(CFrogRenameAutoAlphaAppendDialog)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		COMMAND_HANDLER(IDOK, BN_CLICKED, OnClickedOK)
		COMMAND_HANDLER(IDC_EDIT_SPOSTFIX, EN_CHANGE, OnEnChangeEditPostfix)
		COMMAND_HANDLER(IDC_EDIT_PREFIX, EN_CHANGE, OnEnChangeEditPrefix)
		// FrogBaseDialog Inherited
		CHAIN_MSG_MAP(CFrogOrderFilesDialog)
	END_MSG_MAP()


	BEGIN_DDX_MAP(CFrogRenameAutoAlphaAppendDialog)
		DDX_TEXT(IDC_EDIT_SPOSTFIX, m_Postfix)
		DDX_TEXT(IDC_EDIT_PREFIX, m_Prefix)
	END_DDX_MAP()

	// Handler prototypes:
	//  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	//  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	//  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);

	LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnClickedOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnEnChangeEditPostfix(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnEnChangeEditPrefix(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	virtual void ExecuteCommand();

	CString m_Postfix;
	CString m_Prefix;
private:
	void SetPostPrePreviewAutoNumAlpha(wstring runningChar, wstring originalName = L"filename.ext");
};


